package com.ppg.basic;

import java.io.UnsupportedEncodingException;

public class StringTest {


    public static void main(String[] args) {


//        try {
//            byte[] bytes = "a".getBytes("utf-16");
//            System.out.println(bytes.length);
//
//            byte[] bytes1 = "a".getBytes();
//            System.out.println(bytes1.length);
//
//            byte[] gbks = "中".getBytes("GBK");
//            System.out.println(gbks.length);
//
//            byte[] bytes2 = "中".getBytes();
//            System.out.println(bytes2.length);
//
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }


        String aa = "aa";

        String bb = "bb";

        String cc = "aa" + "bb";

        String dd = "aa" + bb;

        String ee = "aabb";

        System.out.println(cc == ee);
        System.out.println(dd.intern() == ee);


    }
}
